package com.classichu.archdemo.data.remote.api;

import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

public class ApiManager {
    private static final String baseUrl = "https://news-at.zhihu.com/";

    private ApiManager() {

    }

    public static ApiManager getInstance() {
        return Inner.INSTANCE;
    }

    private static class Inner {
        private static final ApiManager INSTANCE = new ApiManager();
    }

    public NewsApi getNewsApi() {
        Retrofit retrofit = new Retrofit.Builder().baseUrl(baseUrl).addConverterFactory(GsonConverterFactory.create()).build();
        return retrofit.create(NewsApi.class);
    }

}
